# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2TypeAggregate do
  @moduledoc """
  A value that combines incremental updates into a summarized value. Data is never directly written or read using type `Aggregate`. Writes provide either the `input_type` or `state_type`, and reads always return the `state_type` .

  ## Attributes

  *   `hllppUniqueCount` (*type:* `GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2TypeAggregateHyperLogLogPlusPlusUniqueCount.t`, *default:* `nil`) - HyperLogLogPlusPlusUniqueCount aggregator.
  *   `inputType` (*type:* `GoogleApi.BigtableAdmin.V2.Model.Type.t`, *default:* `nil`) - Type of the inputs that are accumulated by this `Aggregate`. Use `AddInput` mutations to accumulate new inputs.
  *   `max` (*type:* `GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2TypeAggregateMax.t`, *default:* `nil`) - Max aggregator.
  *   `min` (*type:* `GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2TypeAggregateMin.t`, *default:* `nil`) - Min aggregator.
  *   `stateType` (*type:* `GoogleApi.BigtableAdmin.V2.Model.Type.t`, *default:* `nil`) - Output only. Type that holds the internal accumulator state for the `Aggregate`. This is a function of the `input_type` and `aggregator` chosen.
  *   `sum` (*type:* `GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2TypeAggregateSum.t`, *default:* `nil`) - Sum aggregator.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :hllppUniqueCount =>
            GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2TypeAggregateHyperLogLogPlusPlusUniqueCount.t()
            | nil,
          :inputType => GoogleApi.BigtableAdmin.V2.Model.Type.t() | nil,
          :max =>
            GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2TypeAggregateMax.t() | nil,
          :min =>
            GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2TypeAggregateMin.t() | nil,
          :stateType => GoogleApi.BigtableAdmin.V2.Model.Type.t() | nil,
          :sum => GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2TypeAggregateSum.t() | nil
        }

  field(:hllppUniqueCount,
    as:
      GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2TypeAggregateHyperLogLogPlusPlusUniqueCount
  )

  field(:inputType, as: GoogleApi.BigtableAdmin.V2.Model.Type)
  field(:max, as: GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2TypeAggregateMax)
  field(:min, as: GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2TypeAggregateMin)
  field(:stateType, as: GoogleApi.BigtableAdmin.V2.Model.Type)
  field(:sum, as: GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2TypeAggregateSum)
end

defimpl Poison.Decoder, for: GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2TypeAggregate do
  def decode(value, options) do
    GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2TypeAggregate.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2TypeAggregate do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
